{% extends "base.html" %}
{% block page_content %}

    <div class="page-header">
        <h1>Stream</h1>
    </div>

    <div>
        {{ wtf.quick_form(form) }}
    </div>

    <div>
    {% if not entries_for_page %}
        <p>Nothing in your chronofile yet.</p>
    {% else %}
        <ul>
        {% for entry in entries_for_page %}
            <li><p><a href="{{ url_for('main.view_entries_for_day', day=entry['timestamp'][:10], _external=True) }}">{{ entry['timestamp'][:10] }}</a> at <a href="{{ url_for('main.view_single_entry', timestamp=entry['timestamp'], _external=True) }}">{{ entry['timestamp'][11:] }}</a>:</br>{{entry['entry']}}</br>
            Tags:
                {% if entry['tags']|length != 0 %}
                    {% for tag in entry['tags'] %}
                        <a href="{{ url_for('main.view_entries_for_tag', tag=tag, _external=True) }}">#{{ tag }}</a>
                    {% endfor %}
                {% else %}
                    none
                {% endif %}
                </p></li>
        {% endfor %}
        </ul>
    {% endif %}
    </div>
    </br>
    <div>
        {% if next_page %}
        <p><a class="btn btn-default" href="{{ url_for('main.view_entries_for_page', page=next_page, _external=True) }}">Older entries</a></p>
        {% endif %}
    </div>

{% endblock %}